跳到主要内容

GetAllHeadingParagraphs

Returns all heading paragraphs from the current document.

Syntax

expression.GetAllHeadingParagraphs();

expression - A variable that represents a ApiDocument class.

Parameters

This method doesn't have any parameters.

Returns

ApiParagraph[]

Example

This example shows how to get all heading paragraphs from the document.

let doc = Api.GetDocument();
let newDocumentStyle = doc.GetStyle("Heading 1");
let paragraph = doc.GetElement(0);
paragraph.SetStyle(newDocumentStyle);
paragraph.AddText("Heading 1");
let headingParagraphs = doc.GetAllHeadingParagraphs();
headingParagraphs[0].SetCaps(true);